home *** CD-ROM | disk | FTP | other *** search
/ Master Visual Basic 3 / Master Visual Basic 3 (SAMS Publishing) (1994).ISO / mvprog / original / ch05 / myclip.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-03-11  |  2.1 KB  |  79 lines

  1. VERSION 2.00
  2. Begin Form frmMyClip 
  3.    Caption         =   "The MyClip Program"
  4.    ClientHeight    =   4020
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1785
  7.    ClientWidth     =   6945
  8.    Height          =   4710
  9.    Icon            =   MYCLIP.FRX:0000
  10.    Left            =   1035
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4020
  13.    ScaleWidth      =   6945
  14.    Top             =   1155
  15.    Width           =   7065
  16.    Begin TextBox txtMyText 
  17.       Height          =   3135
  18.       Left            =   0
  19.       MultiLine       =   -1  'True
  20.       ScrollBars      =   3  'Both
  21.       TabIndex        =   0
  22.       Top             =   0
  23.       Width           =   5175
  24.    End
  25.    Begin Menu mnuFile 
  26.       Caption         =   "&File"
  27.       Begin Menu mnuExit 
  28.          Caption         =   "E&xit"
  29.       End
  30.    End
  31.    Begin Menu mnuEdit 
  32.       Caption         =   "&Edit"
  33.       Begin Menu mnuCopy 
  34.          Caption         =   "&Copy"
  35.          Shortcut        =   ^C
  36.       End
  37.       Begin Menu mnuCut 
  38.          Caption         =   "C&ut"
  39.          Shortcut        =   ^X
  40.       End
  41.       Begin Menu mnuPaste 
  42.          Caption         =   "&Paste"
  43.          Shortcut        =   ^V
  44.       End
  45.    End
  46. Option Explicit
  47. Sub Form_Resize ()
  48.     ' The height of the text box should have the same
  49.     ' height as the form.
  50.     txtMyText.Height = frmMyClip.ScaleHeight
  51.     ' The width of the text box should have the same
  52.     ' width as the form.
  53.     txtMyText.Width = frmMyClip.ScaleWidth
  54. End Sub
  55. Sub mnuCopy_Click ()
  56.     ' Clear the clipboard
  57.     Clipboard.Clear
  58.     ' Copy to the clipboard the currently
  59.     ' selected text.
  60.     Clipboard.SetText txtMyText.SelText
  61. End Sub
  62. Sub mnuCut_Click ()
  63.     ' Clear the clipboard
  64.     Clipboard.Clear
  65.     ' Copy to the clipboard the currently
  66.     ' selected text.
  67.     Clipboard.SetText txtMyText.SelText
  68.     ' Replace the currently selected text
  69.     ' with null.
  70.     txtMyText.SelText = ""
  71. End Sub
  72. Sub mnuExit_Click ()
  73.     End
  74. End Sub
  75. Sub mnuPaste_Click ()
  76.     ' Do the Paste operation
  77.     txtMyText.SelText = Clipboard.GetText()
  78. End Sub
  79.